package com.whsxt.feign;

import com.whsxt.domain.Basket;
import com.whsxt.feign.hystrix.OrderCartFeignHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author: caoqingwen
 * @CreateTime: 2021-03-26 14:19
 * @Description:
 */
@FeignClient(value = "cart-service", fallback = OrderCartFeignHystrix.class)
public interface OrderCartFeign {


    /**
     * 远程调用购物车，拿到购物车的商品集合
     *
     * @param basketIds
     * @return
     */
    @PostMapping("/getBasketByIds")
    List<Basket> getBasketByIds(@RequestParam List<Long> basketIds);


    /**
     * 清空购物车
     *
     * @param openId
     * @param skuIds
     */
    @PostMapping("/cleanCart")
    void cleanCart(@RequestParam String openId, @RequestParam List<Long> skuIds);


}
